package com.dabai.qrcodescan.qrcode;

import android.app.Activity;
import android.content.Intent;

import com.dabai.qrcodescan.ui.QrCodeScannerActivity;

/**
 * 二维码生成工具
 */
public class QRCodeScanUtils {

    /**
     * 得到二维码扫描仪结果
     *
     * @param data 数据
     * @return {@link String}
     */
    public static String getQrCodeScannerResult(Intent data){
        return data.getStringExtra("qrContent");
    }

    /**
     * 启动二维码扫描仪
     *
     * @param activity 活动
     * @param reqCode  申请代码
     */
    public static void startQrCodeScanner(Activity activity, int reqCode){
      // 跳转逻辑
        Intent intent = new Intent(activity, QrCodeScannerActivity.class);
        activity.startActivityForResult(intent, reqCode);
    }

}
